<template>
	<div>
		<el-upload class="avatar-uploader"
		    action="http://hansnxcx.hansn.cn/index.php/index/Userinfo/uploadfile"
			:show-file-list="false" 
			:data="{tokenid:'nf2021113012336899abc'}"
			:on-success="editimage">
			<img v-if="images" :src="'http://hansnxcx.hansn.cn'+images" class="avatar" />
			<i v-else class="el-icon-plus avatar-uploader-icon"></i>
		</el-upload>
	</div>

</template>

<script lang="ts">
	var datas;
	import {
		ElMessageBox,
		ElMessage
	} from 'element-plus'
	export default {
		data() {
			return {
				images:""
			}
		},
		
		mounted() {
			this.getData();
		},
		methods: {
		 async	editimage({data}){
				
			await	this.$http.post("/index.php/index/Userinfo/addindeximg",{tokenid:'nf2021113012336899abc',images:data})
			this.images=data;
			},
		
			getData() {
				
				this.$http.post("/index.php/index/Userinfo/indeximg",{tokenid:'666ffnf2021113012336899abc'}).then(data => {   
					console.log(data)
					 this.images = data[0].images;
					
				})
			},

			handleAvatarSuccess(file) {

				this.form.image = file.data;
			},



		}
	}
</script>
<style type="text/css">
	/* .el-upload{
		width: 150px;
		min-height: 150px;
		display: flex !important;
		justify-content: center;
		align-items: center;
		border: 1px solid black;
	} */
</style>
